package com.prs.crm.domain.crm;

import java.util.Date;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.District;
import com.prs.crm.domain.FlowCodeEntity;
import com.prs.crm.domain.sys.Code;

@Entity
@Table(name="crm_rival")
public class Rival extends FlowCodeEntity{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	private String name;
	private String rivalcode;
	@ManyToOne
	private RivalLevel rivalLevel;
	@ManyToOne
	private RivalNature rivalNature;
	@ManyToOne
	private District district;
	private Date setUpTime;
	private String legalPerson;
	private String regCapital;
	private String unitScope;
	private String capitalScope;
	private String annualSales;
	private String nopm;
	private String marketShare;
	private String officePhone;
	private String fax;
	private String url;
	private String email;
	private String address;
	private String postcode;
	@Lob
	private String synopsis;
	private String businessDirection;
	private String gweld;
	private String salesMode;
	private String competitiveAdvantages;
	private String competitiveDisadvantage;
	private String competitiveStrategy;
	@ManyToOne(fetch = FetchType.LAZY)
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private Attachment attach;
	@OneToMany(fetch=FetchType.LAZY,mappedBy="rival")
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private Set<RivalTrends> rivalTrends;
//	@OneToOne(fetch=FetchType.LAZY,mappedBy="rival")
//	private Code code;
//	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public RivalLevel getRivalLevel() {
		return rivalLevel;
	}
	public void setRivalLevel(RivalLevel rivalLevel) {
		this.rivalLevel = rivalLevel;
	}
	public RivalNature getRivalNature() {
		return rivalNature;
	}
	public void setRivalNature(RivalNature rivalNature) {
		this.rivalNature = rivalNature;
	}
	public District getDistrict() {
		return district;
	}
	public void setDistrict(District district) {
		this.district = district;
	}
	public Date getSetUpTime() {
		return setUpTime;
	}
	public void setSetUpTime(Date setUpTime) {
		this.setUpTime = setUpTime;
	}
	public String getLegalPerson() {
		return legalPerson;
	}
	public void setLegalPerson(String legalPerson) {
		this.legalPerson = legalPerson;
	}
	public String getRegCapital() {
		return regCapital;
	}
	public void setRegCapital(String regCapital) {
		this.regCapital = regCapital;
	}
	public String getUnitScope() {
		return unitScope;
	}
	public void setUnitScope(String unitScope) {
		this.unitScope = unitScope;
	}
	public String getCapitalScope() {
		return capitalScope;
	}
	public void setCapitalScope(String capitalScope) {
		this.capitalScope = capitalScope;
	}
	public String getAnnualSales() {
		return annualSales;
	}
	public void setAnnualSales(String annualSales) {
		this.annualSales = annualSales;
	}
	public String getNopm() {
		return nopm;
	}
	public void setNopm(String nopm) {
		this.nopm = nopm;
	}
	public String getMarketShare() {
		return marketShare;
	}
	public void setMarketShare(String marketShare) {
		this.marketShare = marketShare;
	}
	public String getOfficePhone() {
		return officePhone;
	}
	public void setOfficePhone(String officePhone) {
		this.officePhone = officePhone;
	}
	public String getFax() {
		return fax;
	}
	public void setFax(String fax) {
		this.fax = fax;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getPostcode() {
		return postcode;
	}
	public void setPostcode(String postcode) {
		this.postcode = postcode;
	}
	public String getSynopsis() {
		return synopsis;
	}
	public void setSynopsis(String synopsis) {
		this.synopsis = synopsis;
	}
	public String getBusinessDirection() {
		return businessDirection;
	}
	public void setBusinessDirection(String businessDirection) {
		this.businessDirection = businessDirection;
	}
	public String getGweld() {
		return gweld;
	}
	public void setGweld(String gweld) {
		this.gweld = gweld;
	}
	public String getSalesMode() {
		return salesMode;
	}
	public void setSalesMode(String salesMode) {
		this.salesMode = salesMode;
	}
	public String getCompetitiveAdvantages() {
		return competitiveAdvantages;
	}
	public void setCompetitiveAdvantages(String competitiveAdvantages) {
		this.competitiveAdvantages = competitiveAdvantages;
	}
	public String getCompetitiveDisadvantage() {
		return competitiveDisadvantage;
	}
	public void setCompetitiveDisadvantage(String competitiveDisadvantage) {
		this.competitiveDisadvantage = competitiveDisadvantage;
	}
	public String getCompetitiveStrategy() {
		return competitiveStrategy;
	}
	public void setCompetitiveStrategy(String competitiveStrategy) {
		this.competitiveStrategy = competitiveStrategy;
	}
	public Attachment getAttach() {
		return attach;
	}
	public void setAttach(Attachment attach) {
		this.attach = attach;
	}
    
	public String getRivalcode() {
		return rivalcode;
	}
	public void setRivalcode(String rivalcode) {
		this.rivalcode = rivalcode;
	}
//	public Code getCode() {
//		return code;
//	}
//	public void setCode(Code code) {
//		this.code = code;
//	}
	public void setRivalTrends(Set<RivalTrends> rivalTrends) {
		this.rivalTrends = rivalTrends;
	}
	public Set<RivalTrends> getRivalTrends() {
		return rivalTrends;
	}
	
}
